package com.demo.controller;

import java.util.List;

import javax.annotation.Resource;





import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.demo.entity.Employee;
import com.demo.service.EmployeesService;

@Controller
public class SelectController {

	@Resource(name="employeesServiceImpl")
	private EmployeesService empService;
    
	@RequestMapping("list.do")
	public String list(Model model){
		return "index1";
	}

	@RequestMapping("selectAll.do")
	public String selectAll(Model model){
		List<Employee>  emps = empService.selectAllEmpTable();
		model.addAttribute("emps", emps);
		return "index";
	}
	@RequestMapping("deleteEmp.do")
	public void deleteEmployee(String id){				
		empService.deleteEmployee(id);
	}
	
	
	
}
